import {useRoutes,Navigate} from "react-router-dom";
import User from '../views/User'
import Movie from '../views/Movie'
import Top250 from '../views/Top250'
import ComingSoon from '../views/ComingSoon'
import Detail from '../views/Detail'
import City from '../views/City'
const RouterView=()=>{
    const routes=useRoutes([
        {
            path:"/",
            element:<Navigate to="/movie/comingSoon"/>
        },
        {
            path:"/movie",
            element:<Movie/>,
            children:[
                {
                    path:"/movie",
                    element:<Navigate to="/movie/comingSoon"/>
                },
                {
                    path:"top250",
                    element:<Top250/>
                },
                {
                    path:"comingSoon",
                    element:<ComingSoon/>
                }
            ]
        },
        {
            path:"/user",
            element:<User/>
        },
        {
            path:"/detail",
            element:<Detail/>
        },{
            path:"/city",
            element:<City/>
        }
    ])
    return routes;
}
export default RouterView